package com.sjg.sys.service;

import com.sjg.sys.dao.SysUserRoleDao;
import com.sjg.sys.entity.SysUserRole;
import com.sjg.sys.utils.CommUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class SysUserRoleService{

    @Resource
    private SysUserRoleDao sysUserRoleDao;

    public int insert(SysUserRole pojo){
        pojo.setId(CommUtil.getPrimaryKey());
        return sysUserRoleDao.insert(pojo);
    }

    public int insertSelective(SysUserRole pojo){
        pojo.setId(CommUtil.getPrimaryKey());
        return sysUserRoleDao.insertSelective(pojo);
    }

    public int insertList(List<SysUserRole> pojos){
        for(SysUserRole userRole:pojos){
            userRole.setId(CommUtil.getPrimaryKey());
        }
        return sysUserRoleDao.insertList(pojos);
    }

    public int update(SysUserRole pojo){
        return sysUserRoleDao.update(pojo);
    }
}
